package com.hellogood.yaohuo.client.helper;

import com.smartgwt.client.data.Record;

public class RecordHelper {
	public static boolean isRecordCompleted(Record[] rds) {
		boolean isComplete = true;
		if (rds != null) {
			boolean allblank = false;
			for (Record r : rds) {
				String amount = r.getAttribute("amount");
				String pluCode = r.getAttribute("pluCode");
				if ((pluCode == null || pluCode.toString().trim().equals("")) && (amount != null && !amount.toString().equals("") && !amount.toString().equals("0"))) {
					isComplete = false;
				} else if ((pluCode != null && !pluCode.toString().trim().equals("")) && (amount == null || amount.toString().equals("") || amount.toString().equals("0"))) {
					isComplete = false;
				} else if ((pluCode == null || pluCode.toString().trim().equals("")) && (amount == null || amount.toString().equals("") || amount.toString().equals("0"))) {

				} else {
					allblank = true;
				}
			}
			if (!allblank) {
				isComplete = false;
			}
		}
		return isComplete;
	}
}
